//package com.banmao.desktoptools.config;
//
//import com.alibaba.druid.pool.DruidDataSource;
//import com.zaxxer.hikari.util.DriverDataSource;
//import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
//import org.springframework.boot.context.properties.ConfigurationProperties;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
//import javax.sql.DataSource;
//import java.util.Properties;
//
//@Configuration
//public class DatasourceConfig {
//
//    @ConfigurationProperties(prefix = "spring.datasource")
//    @Bean
//    public DataSource druidDataSource() {
//        System.out.println("进入配置类");
//        String url = "jdbc:mysql://47.106.133.98:3306/wx_notebook";
//        String userName = "root";
//        String password = "Banmao1qaz@wsx";
//        String className = "com.mysql.cj.jdbc.Driver";
//        Properties properties = new Properties();
//
//        DruidDataSource druidDataSource = new DruidDataSource();
//        druidDataSource.setUsername(userName);
//        druidDataSource.setUrl(url);
//        druidDataSource.setPassword(password);
//        druidDataSource.setDriverClassName(className);
//        return druidDataSource;
//
//    }
//
//    @Bean
//    public DataSourceProperties setDaaSourceProperties() {
//        System.out.println("进入配置类2");
//        String url = "jdbc:mysql://47.106.133.98:3306/wx_notebook";
//        String userName = "root";
//        String password = "Banmao1qaz@wsx";
//        String className = "com.mysql.cj.jdbc.Driver";
//        DataSourceProperties properties = new DataSourceProperties();
//        properties.setUrl(url);
//        properties.setUsername(userName);
//        properties.setPassword(password);
//        properties.setDriverClassName(className);
//        return properties;
//    }
//
//}